package com.guxingke.nioserver.test;

import com.alibaba.fastjson.JSON;
import com.guxingke.nioserver.core.HttpRequest;
import com.guxingke.nioserver.core.HttpResponse;
import com.guxingke.nioserver.event.EventAdapter;
import com.guxingke.nioserver.exception.ServerException;

/**
 * Created by guxingke on 15-8-19.
 */
public class LogEvent extends EventAdapter {
    @Override
    public void onError(ServerException serverException) {
        System.out.println("on error");
        super.onError(serverException);
    }

    @Override
    public void onAccept() throws Exception {
        System.out.println("on accept");
        super.onAccept();
    }

    @Override
    public void onAccepted(HttpRequest request) throws Exception {
        System.out.println("on accepted");
        super.onAccepted(request);
    }

    @Override
    public void onRead(HttpRequest request) throws Exception {
        System.out.println("on read");
        super.onRead(request);
    }

    @Override
    public void onWrite(HttpRequest request, HttpResponse response) throws Exception {
        System.out.println("on write");
    }

    @Override
    public void onClosed(HttpRequest request) throws Exception {
        System.out.println("on closed");
        super.onClosed(request);
    }
}
